import e from './native.js';
import i from './rng.js';
import { unsafeStringify as d } from './stringify.js';
function g(n, m, t) {
  if (e.randomUUID && !m && !n) return e.randomUUID();
  n = n || {};
  const r = n.random || (n.rng || i)();
  if (((r[6] = (r[6] & 15) | 64), (r[8] = (r[8] & 63) | 128), m)) {
    t = t || 0;
    for (let a = 0; a < 16; ++a) m[t + a] = r[a];
    return m;
  }
  return d(r);
}
export { g as default };
